/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1 MySQL
 Source Server Type    : MySQL
 Source Server Version : 80200 (8.2.0)
 Source Host           : 127.0.0.1:3306
 Source Schema         : ruoyi-vue-pro

 Target Server Type    : MySQL
 Target Server Version : 80200 (8.2.0)
 File Encoding         : 65001

 Date: 12/05/2025 09:09:45
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for erp_purchase_return
-- ----------------------------
DROP TABLE IF EXISTS `erp_purchase_return`;
CREATE TABLE `erp_purchase_return`  (
  `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号',
  `no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '采购退货单号',
  `status` int NOT NULL DEFAULT 0 COMMENT '退货状态',
  `supplier_id` bigint NOT NULL DEFAULT 0 COMMENT '供应商编号',
  `account_id` bigint NOT NULL DEFAULT 0 COMMENT '结算账户编号',
  `return_time` datetime NULL DEFAULT NULL COMMENT '退货时间',
  `order_id` bigint NOT NULL DEFAULT 0 COMMENT '采购订单编号',
  `order_no` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '采购订单号',
  `total_count` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '合计数量',
  `total_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '最终合计价格，单位：元',
  `refund_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '已退款金额，单位：元',
  `total_product_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '合计产品价格，单位：元',
  `total_tax_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '合计税额，单位：元',
  `discount_percent` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '优惠率，百分比',
  `discount_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '优惠金额，单位：元',
  `other_price` decimal(18, 2) NOT NULL DEFAULT 0.00 COMMENT '其它金额，单位：元',
  `file_url` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '附件地址',
  `remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL COMMENT '备注',
  `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者',
  `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者',
  `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
  `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'ERP 采购退货表';

-- ----------------------------
-- Records of erp_purchase_return
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;